<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
  <head>
	<title>公共平台 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- 样式文件的引入 -->
	<link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css">
	<!-- jqueryUI JS文件的引入 -->
	<script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
	<!-- jqueryUI国际化 -->
	<script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
	<!-- 开发使用的公用js方法 -->
	<script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
	<!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
	<script type="text/javascript">var ctx = '${ctx}';var actionExt = "action";var i18n = new Object();</script>
	<script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
  </head>
  
  <body>
    <div class="easyui-layout" data-options="fit:true,border:false" >
		<div data-options="region:'center',border:true">
			<div class="easyui-layout" data-options="fit:true,border:false" >
				<div data-options="region:'north',border:false" style="padding: 4px;height: 50px;overflow: hidden;">
					<div class="easyui-panel" data-options="fit:true,border:true" >
						<div  class="queryContent">
							<form name="search" id="searchAdvForm" method="post" action="" style="display: none; ">
								<table class="queryTable" >
									<tbody>
										<tr>
											<th>广告名称</th>
											<td width="10%">
											<input class="easyui-validatebox" type="text" name="content" maxlength="20" style="width:120px"></input></td>
										    <th width="10%">操作时间</th>
							                 <td width="10%">
							                <input id="startTime" class="easyui-datebox" type="text" name="startTime"  data-options="validType:['dateTimeLessCompare[\'endTime\']']" maxlength="20" style="width:140px"/>-<input id="endTime" class="easyui-datebox" type="text"  data-options="validType:['dateTimeMoreCompare[\'startTime\']']" name="endTime" maxlength="20" style="width:140px"/></td>
											
											<td align="right" width="10%"><a href="javascript:void(0);" class="easyui-linkbutton" id="searchAdv" plain="true">查询</a>
											<a href="javascript:void(0);" class="easyui-linkbutton" id="resetSearchAdvtype" plain="true">清空</a></td>
										</tr>
									</tbody>
								</table>
							</form>
						</div>
					</div>
				</div>
			<div data-options="region:'center',border:false" style="padding: 4px;">
		    <table id="listAdvTable" class="easyui-datagrid" 
				data-options="singleSelect:false,toolbar:'#tb',method:'post',rownumbers:true,fit:true,fitColumns:true,border:true,
					pagination:true,remoteSort:true,multiSort:true,striped:true,onLoadSuccess:function(data){$('#'+paramObj.searchID).attr('disabled',false);},
					url:'${ctx}/business/webadv/list'"}>
				<thead>
					<tr>
					<th data-options="field:'id',checkbox:true"></th>					
					<th data-options="field:'content',width:100,sortable:true,formatter: function(value,row,index){
								return '<a href=javascript:void(0);  onclick=openDataDialog(paramObj,\''+row.id+'\',undefined) >'+value+'</a>';
							},title:'广告名称'"></th>
				 	<th data-options="field:'positionname',width:50,title:'所属广告位'" align="left",></th>
					<th data-options="field:'typename',width:50,title:'类别'" align='left'></th>
					<th data-options="field:'startTime',width:50,title:'开始时间'" align='center'></th>
					<th data-options="field:'endTime',width:50,title:'结束时间'" align='center'></th>
					<th data-options="field:'createrName',width:50,title:'广告主'" align='left'></th>
					<th data-options="field:'createTime',sortable:true,width:50,title:'添加时间'" align="center"></th>
					<th data-options="field:'updateTime',sortable:true,width:50,title:'更新时间'" align="center"></th>
					</tr>
				</thead>
			</table>
			<div id="tb" style="display: none;">
				<div>
					<a href="javascript:void(0);" onclick="openDataDialog(paramObj,undefined,undefined);" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
					<a href="javascript:void(0);" onclick="updateData(paramObj,undefined);" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
					<a href="javascript:void(0);" onclick="deleteData(paramObj,undefined);" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
				</div>
			</div>
		</div>
		</div>
		</div>
		<div id="showAdvDialog"></div>
	</div>
	<script type="text/javascript">
		//初始化表格对应的js对象
		var paramObj;
		$(function() {
			//初始化表格对象数据
			paramObj = new initParams(
					{
						paramObjName : 'paramObj',//表格对应的实体对象名称，好区分多个表格情况下的对象
						tableId:'listAdvTable',
						addDataFormId:'addAdvDataForm',
						showDialogId:'firstLevelDialog',
						searchID:'searchAdv',
						resetSearchID:'resetSearchAdvtype',
						searchFormID:'searchAdvForm',
						updateUrl:'${ctx}/business/webadv/input?id=',
						deleteUrl:'${ctx}/business/webadv/remove',
						addDialogWidth:650,
						addDialogHeight:210,
						ctx:'${ctx}',
						addDialogTitle:'广告信息设置'
					});
			//初始化查询
			init(paramObj);

		});
	</script>
  </body>
</html>
